#include<omp.h>
#include<cstdio>

int atomic_read(const int* p)
{
	int value;
#pragma omp atomic read
	value = *p;
	return value;
}

void atomic_write(int* p, int value)
{
#pragma omp atomic write
	*p = value;
}